<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Order Generation</title>
    <link rel="stylesheet" href="../../layui-v2.9.10/layui/css/layui.css">
    <style>
        body {
            background-color: #f5f5f5;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 0;
            padding: 0;
        }
        .layui-header {
            background-color: #303030;
            color: #fff;
            padding: 0 15px;
        }
        .layui-side, .layui-layout-admin .layui-body, .layui-footer {
            background-color: #f5f5f5;
            color: #333;
        }
        .layui-card-header {
            background-color: #303030;
            color: #fff;
        }
        .layui-card-body {
            background-color: #fff;
            color: #333;
        }
        .layui-layout-admin .layui-body {
            padding: 15px;
        }
    </style>
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <!-- 头部导航 -->
    <div class="layui-header">
        <jsp:include page="header.jsp" />
    </div>

    <!-- 侧边栏 -->
    <div class="layui-side">
        <jsp:include page="side.jsp" />
    </div>

    <!-- 主体内容区 -->
    <div class="layui-body">
        <div class="layui-container">
            <div class="layui-row">
                <div class="layui-col-md12">
                    <form class="layui-form" action="${pageContext.request.contextPath}/EditOrderServlet.do" method="post">
                        <input type="hidden" name="order_id" value="${order.order_id}"/>
                        <div class="margin-top"></div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">收件人</label>
                            <div class="layui-input-block">
                                <input type="text" name="recipient_name" required lay-verify="required" placeholder="请输入收件人" autocomplete="off" class="layui-input" value="${order.recipient_name}">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">收件地址</label>
                            <div class="layui-input-block">
                                <input type="text" name="recipient_address" required lay-verify="required" placeholder="请输入收件地址" autocomplete="off" class="layui-input" value="${order.recipient_address}">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">收件电话</label>
                            <div class="layui-input-block">
                                <input type="text" name="recipient_phone" required lay-verify="required" placeholder="请输入收件电话" autocomplete="off" class="layui-input" value="${order.recipient_phone}">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">订单备注</label>
                            <div class="layui-input-block">
                                <input type="text" name="notes" placeholder="请输入订单备注" autocomplete="off" class="layui-input" value="${order.notes}">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">订单状态</label>
                            <div class="layui-input-block">
                                <input type="text" name="order_status" required lay-verify="required" placeholder="请输入订单状态" autocomplete="off" class="layui-input" value="${order.order_status}">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">订单总额</label>
                            <div class="layui-input-block">
                                <input type="text" name="order_total" required lay-verify="required" placeholder="请输入订单总额" autocomplete="off" class="layui-input" value="${order.order_total}">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
                                <a href="orderManager.jsp" class="layui-btn layui-btn-primary">取消</a>
                            </div>
                        </div>
                    </form>
                    <c:if test="${not empty error}">
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <p style="color: red;">${error}</p>
                            </div>
                        </div>
                    </c:if>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="../../layui-v2.9.10/layui/layui.js"></script>
<script>
    layui.use('form', function(){
        var form = layui.form;
    });
</script>
</body>
</html>
